package com.ruoyi.domain.traceability;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * 追溯记录对象 mes_traceability_record
 * 
 * @author ruoyi
 * @date 2025-01-01
 */
@Data
public class MesTraceabilityRecord extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 追溯记录ID */
    private Long traceId;

    /** 追溯编号 */
    @Excel(name = "追溯编号")
    private String traceCode;

    /** 追溯类型（FORWARD正向追溯 REVERSE反向追溯） */
    @Excel(name = "追溯类型", readConverterExp = "FORWARD=正向追溯,REVERSE=反向追溯")
    private String traceType;

    /** 追溯对象类型（PRODUCT产品 BATCH批次 MATERIAL物料） */
    @Excel(name = "追溯对象类型", readConverterExp = "PRODUCT=产品,BATCH=批次,MATERIAL=物料")
    private String objectType;

    /** 追溯对象ID */
    @Excel(name = "追溯对象ID")
    private Long objectId;

    /** 追溯对象编码 */
    @Excel(name = "追溯对象编码")
    private String objectCode;

    /** 追溯对象名称 */
    @Excel(name = "追溯对象名称")
    private String objectName;

    /** 批次号 */
    @Excel(name = "批次号")
    private String batchCode;

    /** 工单ID */
    @Excel(name = "工单ID")
    private Long workOrderId;

    /** 工单编号 */
    @Excel(name = "工单编号")
    private String workOrderCode;

    /** 产品ID */
    @Excel(name = "产品ID")
    private Long productId;

    /** 产品编码 */
    @Excel(name = "产品编码")
    private String productCode;

    /** 产品名称 */
    @Excel(name = "产品名称")
    private String productName;

    /** 工序ID */
    @Excel(name = "工序ID")
    private Long processId;

    /** 工序编码 */
    @Excel(name = "工序编码")
    private String processCode;

    /** 工序名称 */
    @Excel(name = "工序名称")
    private String processName;

    /** 车间ID */
    @Excel(name = "车间ID")
    private Long workshopId;

    /** 车间名称 */
    @Excel(name = "车间名称")
    private String workshopName;

    /** 工位ID */
    @Excel(name = "工位ID")
    private Long workstationId;

    /** 工位名称 */
    @Excel(name = "工位名称")
    private String workstationName;

    /** 设备ID */
    @Excel(name = "设备ID")
    private Long equipmentId;

    /** 设备名称 */
    @Excel(name = "设备名称")
    private String equipmentName;

    /** 操作员ID */
    @Excel(name = "操作员ID")
    private Long operatorId;

    /** 操作员姓名 */
    @Excel(name = "操作员姓名")
    private String operatorName;

    /** 质检记录ID */
    @Excel(name = "质检记录ID")
    private Long inspectionId;

    /** 质检结论 */
    @Excel(name = "质检结论")
    private String inspectionResult;

    /** 库存记录ID */
    @Excel(name = "库存记录ID")
    private Long inventoryRecordId;

    /** 仓库ID */
    @Excel(name = "仓库ID")
    private Long warehouseId;

    /** 仓库名称 */
    @Excel(name = "仓库名称")
    private String warehouseName;

    /** 供应商ID */
    @Excel(name = "供应商ID")
    private Long supplierId;

    /** 供应商名称 */
    @Excel(name = "供应商名称")
    private String supplierName;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /** 追溯深度 */
    @Excel(name = "追溯深度")
    private Integer traceDepth;

    /** 状态（0正常 1异常） */
    @Excel(name = "状态", readConverterExp = "0=正常,1=异常")
    private String status;

    /** 备注信息 */
    @Excel(name = "备注信息")
    private String remarks;

    /** 追溯路径JSON */
    private String tracePath;

    /** 关联的追溯详情列表 */
    private List<MesTraceabilityDetail> traceDetails;
}